#include <iostream>
#include <string>
// 包含SpireMS SDK头文件
#include <sms_core.h>


int main(int argc, char *argv[])
{
    sms::Publisher pub("/topic/any", "std_msgs::Null");
    int cnt = 0;
    while (1)
    {
        nlohmann::json msg = sms::def_msg("std_msgs::Null");
        msg["cnt"] = cnt;
        cnt ++;
        msg["str1"] = "hello!!";
        msg["str2"] = "hello2!@@@";
        msg["pos"] = {1, 2, 3};
        pub.publish(msg);
        sms::msleep(1000);
    }

    pub.join();
    return 0;
}

